package com.program.cloudmanagesystem.hotel.service;

import com.program.cloudmanagesystem.hotel.domain.Human;
import com.program.cloudmanagesystem.hotel.domain.Vehicle;
import com.program.cloudmanagesystem.hotel.persistence.HumanMapper;
import com.program.cloudmanagesystem.hotel.persistence.VehicleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class VehicleService {
    @Autowired
    private VehicleMapper vehicleMapper;
    public VehicleService(){}
    public List<Vehicle> showVehicles(){
        return vehicleMapper.showVehicles();
    }
    public Vehicle searchVehicle(String lisence){
        return vehicleMapper.searchVehicle(lisence);
    }
    public void insertVehicle(Vehicle vehicle){
        vehicleMapper.insertVehicle(vehicle.getId(),vehicle.getLisence(),vehicle.getStyle(),vehicle.getBase(),vehicle.getDate(),vehicle.getHotelid());
    }
    public void deleteVehicle(int id)
    {
        vehicleMapper.deleteVehicle(id);
    }
    public void updateData(Vehicle vehicle)
    {
        vehicleMapper.updateData(vehicle.getId(),vehicle.getLisence(),vehicle.getStyle(),vehicle.getBase(),vehicle.getDate(),vehicle.getHotelid());
    }
    public List<Vehicle> showVehiclesByHotelId(String hotelId){return vehicleMapper.showVehiclesByHotelId(hotelId);}
}
